package com.bjpowernode.crm.workbench.service.impl;

import com.bjpowernode.crm.workbench.domain.Activity;
import com.bjpowernode.crm.workbench.mapper.ActivityMapper;
import com.bjpowernode.crm.workbench.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * ClassName:ActivityServiceImpl
 * Package:com.bjpowernode.crm.workbench.service.impl
 * Date:2022/6/8 12:22
 * Description:
 * Author:zsm@zhangshuming.com
 */
@Service
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    ActivityMapper activityMapper;
    @Override
    public List<Activity> queryActivityListByCondition(Map<String, Object> param) {
        return activityMapper.selectActivityByCondition(param);
    }

    @Override
    public void saveCreateActivity(Activity activity) {
        activityMapper.insertSelective(activity);
    }

    @Override
    public Activity queryActivityById(String id) {
        Activity activity = activityMapper.selectByPrimaryKey(id);
        return activity;
    }

    @Override
    public void saveEditActivity(Activity activity) {
        activityMapper.updateByPrimaryKeySelective(activity);
    }

    @Override
    public void deleteActivityData(String[] ids) {
        activityMapper.deleteActivityById(ids);
    }

    @Override
    public void saveImportActivityList(List<Activity> activityList) {
        activityMapper.saveImportActivityList(activityList);
    }

    @Override
    public List<Activity> queryActivityByIds(String[] ids) {
        return activityMapper.selectActivityByIds(ids);
    }

    @Override
    public Activity queryActivityDetailById(String id) {
        return activityMapper.selectActivityDetailById(id);
    }

    @Override
    public List<Activity> queryActivityByClueId(String clueId) {
        return activityMapper.selectActivityByClueId(clueId);
    }

    @Override
    public List<Activity> querysearchActivityByClueId(String clueId, String searchActivityName) {
        return activityMapper.selectSearchActivityByClueId(clueId,searchActivityName);
    }

    @Override
    public void deleteClueCorrelate(String activityId, String clueId) {
        activityMapper.deleteClueCorrelate(activityId,clueId);
    }

    @Override
    public List<Activity> queryClueActivityByIdList(String clueId, String searchActivityText) {
        return activityMapper.selectClueActivityByIdList(clueId,searchActivityText);
    }


}
